import tensorflow as tf
import os

if __name__ == '__main__':
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
    # 输入的维度是 1 行 3 列
    X = tf.random.normal([1, 3])
    print(X)
    # 权重的维度 输入的列为行数，输出的个数列数
    W = tf.Variable(tf.random.truncated_normal([3, 2], stddev=0.1))
    print(W)
    # 偏置的维度 输出的个数
    b = tf.Variable(tf.zeros([2]))
    print(b)
    # 线性变换
    # O = X @ W + b
    O1 = tf.matmul(X, W)
    O = tf.add(O1, b)
    print(O)
    output = tf.nn.relu(O)
    print(output)
